/*     */ package com.lmpop.trade.ti_teamorder;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.dao.IbatisDbmImpl;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_teamorderInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_teamorderInfo()
/*     */   {
/*  19 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  29 */     RandomID randId = new RandomID();
/*  30 */     String info_id = randId.GenTradeId();
/*     */ 
/*  32 */     Ti_teamorder ti_teamorder = new Ti_teamorder();
/*  33 */     ti_teamorder.setTrade_id(info_id);
/*     */ 
/*  35 */     ti_teamorder.setOrder_no(map.getString("order_no"));
/*  36 */     ti_teamorder.setInfo_id(map.getString("info_id"));
/*  37 */     ti_teamorder.setNum(map.getInt("num"));
/*  38 */     ti_teamorder.setPrice(map.getString("price"));
/*  39 */     ti_teamorder.setTotal_price(map.getString("total_price"));
/*  40 */     ti_teamorder.setUser_id(map.getString("user_id"));
/*  41 */     ti_teamorder.setCellphone(map.getString("cellphone"));
/*  42 */     ti_teamorder.setRand_no(map.getString("rand_no"));
/*  43 */     ti_teamorder.setOrder_state(map.getString("order_state"));
/*  44 */     ti_teamorder.setArea_attr(map.getString("area_attr"));
/*  45 */     ti_teamorder.setAddress(map.getString("address"));
/*  46 */     ti_teamorder.setPost_code(map.getString("post_code"));
/*  47 */     ti_teamorder.setName(map.getString("name"));
/*  48 */     ti_teamorder.setSend_time(map.getString("send_time"));
/*  49 */     ti_teamorder.setRemark(map.getString("remark"));
/*  50 */     ti_teamorder.setInvoice(map.getString("invoice"));
/*  51 */     ti_teamorder.setIn_date(map.getString("in_date"));
/*  52 */     ti_teamorder.setVmoney(map.getString("vmoney"));
/*  53 */     ti_teamorder.setCust_id(map.getString("cust_id"));
/*  54 */     ti_teamorder.setBest_time(map.getString("best_time"));
/*  55 */     ti_teamorder.setShipping_id(map.getString("shipping_id"));
/*  56 */     ti_teamorder.setShip_name(map.getString("ship_name"));
/*  57 */     ti_teamorder.setPay_id(map.getString("pay_id"));
/*  58 */     ti_teamorder.setPay_name(map.getString("pay_name"));
/*  59 */     ti_teamorder.setShip_price(map.getString("ship_price"));
/*  60 */     String result_code = "0";
/*     */     try {
/*  62 */       insert(dbmMgr, ti_teamorder);
/*     */     } catch (ApplicationException e) {
/*  64 */       e.printStackTrace();
/*  65 */       result_code = "1";
/*     */     }
/*  67 */     map.setString("result_code", result_code);
/*  68 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_teamorder ti_teamorder)
/*     */     throws ApplicationException
/*     */   {
/*  77 */     dbmMgr.update("insertTi_teamorder", ti_teamorder);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  87 */     String pkid_string = map.getString("pkid");
/*  88 */     String result_code = "0";
/*     */     try {
/*  90 */       if (!pkid_string.equals("")) {
/*  91 */         String[] pkStr = pkid_string.split("\\|");
/*  92 */         for (int i = 0; i < pkStr.length; i++) {
/*  93 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  97 */       e.printStackTrace();
/*  98 */       result_code = "1";
/*     */     }
/* 100 */     map.setString("result_code", result_code);
/* 101 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 110 */     dbmMgr.update("deleteTi_teamorder", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 119 */     Ti_teamorder ti_teamorder = new Ti_teamorder();
/* 120 */     ti_teamorder.setTrade_id(map.getString("trade_id"));
/* 121 */     ti_teamorder.setOrder_no(map.getString("order_no"));
/* 122 */     ti_teamorder.setInfo_id(map.getString("info_id"));
/* 123 */     ti_teamorder.setNum(map.getInt("num"));
/* 124 */     ti_teamorder.setPrice(map.getString("price"));
/* 125 */     ti_teamorder.setTotal_price(map.getString("total_price"));
/* 126 */     ti_teamorder.setUser_id(map.getString("user_id"));
/* 127 */     ti_teamorder.setCellphone(map.getString("cellphone"));
/* 128 */     ti_teamorder.setRand_no(map.getString("rand_no"));
/* 129 */     ti_teamorder.setOrder_state(map.getString("order_state"));
/* 130 */     ti_teamorder.setArea_attr(map.getString("area_attr"));
/* 131 */     ti_teamorder.setAddress(map.getString("address"));
/* 132 */     ti_teamorder.setPost_code(map.getString("post_code"));
/* 133 */     ti_teamorder.setName(map.getString("name"));
/* 134 */     ti_teamorder.setRemark(map.getString("remark"));
/* 135 */     ti_teamorder.setInvoice(map.getString("invoice"));
/* 136 */     ti_teamorder.setIn_date(map.getString("in_date"));
/* 137 */     ti_teamorder.setCust_id(map.getString("cust_id"));
/* 138 */     String result_code = "0";
/*     */     try {
/* 140 */       update(dbmMgr, ti_teamorder);
/*     */     } catch (ApplicationException e) {
/* 142 */       e.printStackTrace();
/* 143 */       result_code = "1";
/*     */     }
/* 145 */     map.setString("result_code", result_code);
/* 146 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_teamorder ti_teamorder)
/*     */     throws ApplicationException
/*     */   {
/* 155 */     dbmMgr.update("updateTi_teamorder", ti_teamorder);
/*     */   }
/*     */ 
/*     */   public void updateTeambuyStateByOnliePay(Object obj)
/*     */   {
/* 161 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 162 */     Map map = (Hashtable)obj;
/* 163 */     String order_no = "";
/* 164 */     String result_code = "0";
/* 165 */     String order_state = "0";
/* 166 */     String price = "0";
/*     */ 
/* 168 */     if (map.get("order_no") != null) order_no = map.get("order_no").toString();
/* 169 */     if (map.get("order_state") != null) order_state = map.get("order_state").toString();
/* 170 */     if (map.get("price") != null) price = map.get("price").toString();
/*     */ 
/* 172 */     List list = this.queryList.getList("checkTeamOrderNo", order_no);
/* 173 */     int checkResult = list.size();
/* 174 */     if (!order_no.equals(""))
/*     */     {
/* 176 */       Hashtable sMap = new Hashtable();
/* 177 */       sMap.put("order_state", order_state);
/* 178 */       sMap.put("price", price);
/* 179 */       if (checkResult > 0) {
/* 180 */         sMap.put("order_no", order_no);
/* 181 */         dbmMgr.updateSql("updateTeamStateByOrderNo", sMap);
/*     */       }
/*     */     }
/*     */   }
/*     */ 
/*     */   public int updateTeamStateByOrderNo(String order_no, String state)
/*     */   {
/* 189 */     Hashtable sMap = new Hashtable();
/* 190 */     if (state.equals("55"))
/* 191 */       sMap.put("order_state", "4");
/*     */     else
/* 193 */       sMap.put("order_state", state);
/* 194 */     sMap.put("order_no", order_no);
/* 195 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/*     */     try {
/* 197 */       dbmMgr.updateSql("updateTeamStateByOrderNo", sMap);
/* 198 */       if (state.equals("4")) {
/* 199 */         dbmMgr.updateSql("returnGoods_alterCur_storeByInfoId", order_no);
/* 200 */         dbmMgr.updateSql("returnteamorderVmoneyByOrderNo", order_no);
/*     */       }
/* 202 */       if (state.equals("55")) {
/* 203 */         dbmMgr.updateSql("returnteamorderVmoneyByOrderNo", order_no);
/*     */       }
/*     */ 
/* 206 */       return 1; } catch (Exception e) {
/*     */     }
/* 208 */     return 0;
/*     */   }
/*     */ 
/*     */   public int updateGroupVoucherNumByOrderNo(String order)
/*     */   {
/* 218 */     int result_code = 0;
/*     */     try {
/* 220 */       DbmInterf dbmMgr = new IbatisDbmImpl();
/* 221 */       dbmMgr.updateSql("updateCur_storeByInfoId", order);
/*     */     } catch (Exception e) {
/* 223 */       e.printStackTrace();
/* 224 */       result_code = 1;
/*     */     }
/* 226 */     return result_code;
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 236 */     Hashtable ti_teamorder = (Hashtable)obj;
/* 237 */     if (start == 0)
/* 238 */       start = 0;
/*     */     else {
/* 240 */       start = (start - 1) * limit;
/*     */     }
/* 242 */     ti_teamorder.put("start", Integer.valueOf(start));
/* 243 */     ti_teamorder.put("limit", Integer.valueOf(limit));
/* 244 */     return this.queryList.getList("getListByTi_teamorderPage", ti_teamorder);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 255 */     Hashtable ti_teamorder = (Hashtable)obj;
/* 256 */     List list = this.queryList.getList("getCountByObjTi_teamorder", ti_teamorder);
/* 257 */     int count = 0;
/* 258 */     if ((list != null) && (list.size() > 0)) {
/* 259 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 260 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 261 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 264 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 274 */     return this.queryList.getList("getTi_teamorderByPk", pk);
/*     */   }
/*     */ 
/*     */   public List getTeamInfoByNO(String trade_no) {
/* 278 */     return this.queryList.getList("getTeamInfoByNO", trade_no);
/*     */   }
/*     */ 
/*     */   public List getTeamPerListByPage(Object obj, int start, int limit) {
/* 282 */     Hashtable ti_teaminfo = (Hashtable)obj;
/* 283 */     if (start == 0)
/* 284 */       start = 0;
/*     */     else {
/* 286 */       start = (start - 1) * limit;
/*     */     }
/* 288 */     ti_teaminfo.put("start", Integer.valueOf(start));
/* 289 */     ti_teaminfo.put("limit", Integer.valueOf(limit));
/* 290 */     return this.queryList.getList("getTeamPerListByPage", ti_teaminfo);
/*     */   }
/*     */ 
/*     */   public List getTeamOneTeamorder(Object obj) {
/* 294 */     Hashtable ti_teaminfo = (Hashtable)obj;
/* 295 */     return this.queryList.getList("getTeamOneTeamorder", ti_teaminfo);
/*     */   }
/*     */ 
/*     */   public int getTeamPerCountByObj(Object obj) {
/* 299 */     Hashtable ti_teaminfo = (Hashtable)obj;
/* 300 */     List list = this.queryList.getList("getTeamPerCountByObj", ti_teaminfo);
/* 301 */     int count = 0;
/* 302 */     if ((list != null) && (list.size() > 0)) {
/* 303 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 304 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 305 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 308 */     return count;
/*     */   }
/*     */ 
/*     */   public int getTeambuyStateByID(String trade_no) {
/* 312 */     List temp = this.queryList.getList("getTeambuyStateByID", trade_no);
/* 313 */     if ((temp != null) && (temp.size() > 0)) {
/* 314 */       return Integer.parseInt(((Hashtable)temp.get(0)).get("order_state").toString());
/*     */     }
/* 316 */     return -1;
/*     */   }
/*     */ 
/*     */   public List getTeamOneTeamorder(Map map)
/*     */   {
/* 321 */     return this.queryList.getList("getTeamOneTeamorder", map);
/*     */   }
/*     */ 
/*     */   public List getTeamPriceByuser(String user_id) {
/* 325 */     return this.queryList.getList("getTeamPriceByuser", user_id);
/*     */   }
/*     */ 
/*     */   public String getGroupOrderNumCount(String month)
/*     */   {
/* 331 */     List uList = this.queryList.getList("getTi_grouporderinfoCountByTime", month);
/* 332 */     String counter = "0";
/* 333 */     if ((uList != null) && (uList.size() > 0))
/*     */     {
/* 335 */       Hashtable map = (Hashtable)uList.get(0);
/* 336 */       if (map.get("count") != null)
/*     */       {
/* 338 */         counter = map.get("count").toString();
/*     */       }
/*     */     }
/* 341 */     return counter;
/*     */   }
/*     */ 
/*     */   public String getGroupOrderStateCount(String state)
/*     */   {
/* 348 */     List uList = this.queryList.getList("getTi_grouporderinfoCountByState", state);
/* 349 */     String counter = "0";
/* 350 */     if ((uList != null) && (uList.size() > 0))
/*     */     {
/* 352 */       Hashtable map = (Hashtable)uList.get(0);
/* 353 */       if (map.get("count") != null)
/*     */       {
/* 355 */         counter = map.get("count").toString();
/*     */       }
/*     */     }
/* 358 */     return counter;
/*     */   }
/*     */ 
/*     */   public int getTeamBuyNum(String order_no)
/*     */   {
/* 364 */     int num = 0;
/* 365 */     List list = this.queryList.getList("getTeamBuyNum", order_no);
/* 366 */     if ((list != null) && (list.size() > 0)) {
/* 367 */       Hashtable map = (Hashtable)list.get(0);
/* 368 */       if (map.get("num") != null) {
/* 369 */         num = Integer.parseInt(map.get("num").toString());
/*     */       }
/*     */     }
/* 372 */     return num;
/*     */   }
/*     */ 
/*     */   public String getOrderNumCount(Hashtable cmap)
/*     */   {
/* 378 */     List uList = this.queryList.getList("getTi_teamorderInfoCountByTime", cmap);
/* 379 */     String counter = "0";
/* 380 */     if ((uList != null) && (uList.size() > 0))
/*     */     {
/* 382 */       Hashtable map = (Hashtable)uList.get(0);
/* 383 */       if (map.get("count") != null)
/*     */       {
/* 385 */         counter = map.get("count").toString();
/*     */       }
/*     */     }
/* 388 */     return counter;
/*     */   }
/*     */ 
/*     */   public String getOrderStateCount(Hashtable smap)
/*     */   {
/* 395 */     List uList = this.queryList.getList("getTi_teamorderInfoCountByState", smap);
/* 396 */     String counter = "0";
/* 397 */     if ((uList != null) && (uList.size() > 0))
/*     */     {
/* 399 */       Hashtable map = (Hashtable)uList.get(0);
/* 400 */       if (map.get("count") != null)
/*     */       {
/* 402 */         counter = map.get("count").toString();
/*     */       }
/*     */     }
/* 405 */     return counter;
/*     */   }
/*     */ 
/*     */   public SysMap sendTeambuyByOrderNo(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 410 */     String result_code = "0";
/* 411 */     Map parammap = new Hashtable();
/* 412 */     parammap.put("order_no", map.getString("order_no"));
/* 413 */     parammap.put("order_state", map.getString("order_state"));
/* 414 */     parammap.put("peisong_no", map.getString("peisong_no"));
/* 415 */     parammap.put("peisong_company", map.getString("peisong_company"));
/*     */     try {
/* 417 */       dbmMgr.update("sendTeambuyByOrderNo", parammap);
/* 418 */       dbmMgr.update("updateCur_storeByInfoId", map.getString("order_no"));
/*     */     } catch (Exception e) {
/* 420 */       e.printStackTrace();
/* 421 */       result_code = "1";
/*     */     }
/* 423 */     map.put("result_code", result_code);
/* 424 */     return map;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_teamorder.Ti_teamorderInfo
 * JD-Core Version:    0.6.0
 */